//
//  NetRequestWithCache_JR.h
//  KidReading
//
//  Created by Yinjialiang on 16/2/26.
//  Copyright © 2016年 刘赞黄Telen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NetRequestWithCahce.h"
@interface NetRequestWithCache_JR : NSObject

+(NetRequestWithCache_JR *)shareSingle;
//基础网络请求
-(void)JR_netRequestWithType:(RequestType)requestType Port:(NSString*)port andBaseUrl:(NSString*)baseUrl parameters:(NSDictionary*)dict success:(void (^)(NSDictionary* retDict))success failure:(void (^)(NSError *error))failure;

//实时请求网络
-(void)JR_netRequestWithCacheType:(RequestType)requestType Port:(NSString *)port baseUrl:(NSString *)baseUrl parameters:(NSDictionary*)dict  keyID:(NSString *)keyId success:(void (^)(NSDictionary* retDict,BOOL hasCache))success failure:(void (^)(NSError *error,BOOL hasCache))failure cache:(void (^)(NSDictionary * cacheRetDict))cacheBack;
//实时请求网络(包含是否缓存参数)
-(void)JR_netRequestWithCacheType:(RequestType)requestType Port:(NSString *)port baseUrl:(NSString *)baseUrl parameters:(NSDictionary*)dict  keyID:(NSString *)keyId NeedCache:(BOOL)isNeedCache success:(void (^)(NSDictionary* retDict,BOOL hasCache))success failure:(void (^)(NSError *error,BOOL hasCache))failure cache:(void (^)(NSDictionary * cacheRetDict))cacheBack;


//五分钟不重复请求网络
-(void)JR_netRequestLimitedWithCacheType:(RequestType)requestType Port:(NSString *)port baseUrl:(NSString *)baseUrl parameters:(NSDictionary*)dict  keyID:(NSString *)keyId success:(void (^)(NSDictionary* retDict,BOOL hasCache))success failure:(void (^)(NSError *error,BOOL hasCache))failure cache:(void (^)(NSDictionary * cacheRetDict))cacheBack;
//五分钟不重复请求网络(包含是否缓存参数)
-(void)JR_netRequestLimitedWithCacheType:(RequestType)requestType Port:(NSString *)port baseUrl:(NSString *)baseUrl parameters:(NSDictionary*)dict  keyID:(NSString *)keyId NeedCache:(BOOL)isNeedCache success:(void (^)(NSDictionary* retDict,BOOL hasCache))success failure:(void (^)(NSError *error,BOOL hasCache))failure cache:(void (^)(NSDictionary * cacheRetDict))cacheBack;
//清除某个接口的五分钟限制时间
-(void)JR_cleanLastLimitedDateWithPort:(NSString*)port BaseUrl:(NSString*)baseUrl keyID:(NSString*)keyId;

- (NSMutableDictionary*)netRequestAddBaseInfo:(NSDictionary*)dict;

@end
